﻿using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;

namespace Domain.Model
{
    public class SelectorBase
    {
        [Key]
        public int Id { get; set; }
        [Display(Name = "ID")]
        public string Name { get; set; } = "_root";
        [Column("text")]
        public string Selector { get; set; } = "";
        [Column("type")]
        public SelectorType Type { get; set; }
        public bool Multiple { get; set; }
        public string? Regex { get; set; } = "";
        [Column("parent_selector_names")]
        public string ParentSelectorNames { get; set; } = "_root";
        [Column("father_id")]
        public int FatherId { get; set; }
        [Column("children_ids")]
        public string ChildrenIds { get; set; } = "";
        [Column("parent_paths")]
        public string ParentPaths { get; set; } = "";
        public int SiteMapId { get; set; }
        public SiteMap SiteMap { get; set; }
    }

    public enum SelectorType
    {
        Text,
        Link,
        Element
    }
}
